package Merlion.util.state;

import java.io.Serializable;
import java.util.Calendar;
import java.util.Date;

public class PlannedDemandState implements Serializable {

    private String id;
    private Integer yearInt;
    private Integer monthInt;
    private Integer weekOfMonth;
    private Integer dayOfMonth;
    private Long productId;
    private String productName;
    private String msrId;
    private int monthlyDemand;
    private int weeklyDemand;
    private int dailyDemand;
    private int adjustedQty;
    private int nWorkdaysInWeek;
    private int nWorkdaysInMonth;
    private Date execDate;

    public PlannedDemandState() {
    }

    public PlannedDemandState(String id, Integer yearInt, Integer monthInt, Integer weekOfMonth, Integer dayOfMonth, Long productId) {
        this.id = id;
        this.yearInt = yearInt;
        this.monthInt = monthInt;
        this.weekOfMonth = weekOfMonth;
        this.dayOfMonth = dayOfMonth;
        this.productId = productId;
    }

    public void createWeeklyPlannedDemandState(String id, Integer yearInt, Integer monthInt, Integer weekOfMonth, Long productId, int monthlyDemand, int weeklyDemand, int nWorkdaysInWeek, int nWorkdaysInMonth) {
        this.id = id;
        this.yearInt = yearInt;
        this.monthInt = monthInt;
        this.weekOfMonth = weekOfMonth;
        this.productId = productId;
        this.monthlyDemand = monthlyDemand;
        this.weeklyDemand = weeklyDemand;
        this.nWorkdaysInWeek = nWorkdaysInWeek;
        this.nWorkdaysInMonth = nWorkdaysInMonth;
    }

    public void createDailyPlannedDemandState(String id, Integer yearInt, Integer monthInt, Integer weekOfMonth, Integer dayOfMonth, Long productId, int monthlyDemand, int dailyDemand, int nWorkdaysInMonth) {
        this.id = id;
        this.yearInt = yearInt;
        this.monthInt = monthInt;
        this.weekOfMonth = weekOfMonth;
        this.dayOfMonth = dayOfMonth;
        this.productId = productId;
        this.monthlyDemand = monthlyDemand;
        this.dailyDemand = dailyDemand;
        this.nWorkdaysInMonth = nWorkdaysInMonth;
        Calendar cal = Calendar.getInstance();
        cal.set(Calendar.YEAR, yearInt);
        cal.set(Calendar.MONTH, monthInt - 1);
        cal.set(Calendar.DATE, dayOfMonth);
        cal.setFirstDayOfWeek(Calendar.MONDAY);
        this.setExecDate(cal.getTime());
    }

    public int getAdjustedQty() {
        return adjustedQty;
    }

    public void setAdjustedQty(int adjustedQty) {
        this.adjustedQty = adjustedQty;
    }

    public String getProductName() {
        return productName;
    }

    public void setProductName(String productName) {
        this.productName = productName;
    }
   
    
    public int getDailyDemand() {
        return dailyDemand;
    }

    public void setDailyDemand(int dailyDemand) {
        this.dailyDemand = dailyDemand;
    }

    public Integer getDayOfMonth() {
        return dayOfMonth;
    }

    public void setDayOfMonth(Integer dayOfMonth) {
        this.dayOfMonth = dayOfMonth;
    }

    public Date getExecDate() {
        return execDate;
    }

    public void setExecDate(Date execDate) {
        this.execDate = execDate;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public Integer getMonthInt() {
        return monthInt;
    }

    public void setMonthInt(Integer monthInt) {
        this.monthInt = monthInt;
    }

    public int getMonthlyDemand() {
        return monthlyDemand;
    }

    public void setMonthlyDemand(int monthlyDemand) {
        this.monthlyDemand = monthlyDemand;
    }

    public String getMsrId() {
        return msrId;
    }

    public void setMsrId(String msrId) {
        this.msrId = msrId;
    }

    public Long getProductId() {
        return productId;
    }

    public void setProductId(Long productId) {
        this.productId = productId;
    }

    public Integer getWeekOfMonth() {
        return weekOfMonth;
    }

    public void setWeekOfMonth(Integer weekOfMonth) {
        this.weekOfMonth = weekOfMonth;
    }

    public int getWeeklyDemand() {
        return weeklyDemand;
    }

    public void setWeeklyDemand(int weeklyDemand) {
        this.weeklyDemand = weeklyDemand;
    }

    public Integer getYearInt() {
        return yearInt;
    }

    public void setYearInt(Integer yearInt) {
        this.yearInt = yearInt;
    }

    public int getnWorkdaysInMonth() {
        return nWorkdaysInMonth;
    }

    public void setnWorkdaysInMonth(int nWorkdaysInMonth) {
        this.nWorkdaysInMonth = nWorkdaysInMonth;
    }

    public int getnWorkdaysInWeek() {
        return nWorkdaysInWeek;
    }

    public void setnWorkdaysInWeek(int nWorkdaysInWeek) {
        this.nWorkdaysInWeek = nWorkdaysInWeek;
    }
}
